/**
 * Created by ying on 2017/7/22.
 */

//引入vue
import Vue from  "vue";
import App from "./App.vue";
//引入Mint ui
import mint from 'mint-ui';
Vue.use(mint);
import '../node_modules/mint-ui/lib/style.css';
//引入mui样式
import './static/css/mui.min.css';

//创建路由
import VueRouter from 'vue-router';
Vue.use(VueRouter);

//Vue的http 请求
import resource from 'vue-resource';
Vue.use(resource);
import home from './component/home/home.vue';
import goods from './component/goods/goods.vue';
import shoppingcar from './component/shoppingcar/shoppingcar.vue';
import settings from './component/settings/settings.vue';
import news from './component/news/news.vue';
import newsinfo from './component/news/newsinfo.vue';

//引入全局样式
import './static/css/main.css';

//创建路由表,实例化路由
let router = new VueRouter({
    //路由切换以后的样式
    linkActiveClass:'mui-active',
    //路由
    routes:[
       //首页
       {path:'/home',component:home},
       //商品列表
       {path:'/goods',component:goods},
       //购物车
       {path:'/settings',component:settings},
       //设置
       {path:'/shoppingcar',component:shoppingcar},
        //新闻路由
       {path:'/news',component:news},
        //新闻详情
       {path:'/newsinfo',component:newsinfo}
   ]
});


//Vue实例化
new Vue({
    el:"#view",
    //设置路由
    router:router,
    render:function (created) {
        return created(App);
    }
});